This method calculates the Variance.
var VAR(period, deviation, dataArray, calculatedDataArray);
period
Period integer value.
deviation
Deviation floating value.
dataArray
Array object filled with any data which will be used as the source for calculation.
calculatedDataArray
Empty Array object that will be filled with calculated data.
Returns true if calculation was completed successfully, or false otherwise.
The following example demonstrates how to use VAR method.
function calculate(beginIndex, endIndex)
{
var period = 15;
var maximum = 1.00;
var dataArray = new Array();
//populate data array...
..
var calculatedDataArray = new Array();
var rc = TechnicalAnalysis.VAR(period, deviation, dataArray, calculatedDataArray);
}
Copyright © 2006-2009 ActiveTick LLC